﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using DukeySoundHelper.API;

namespace DukeySoundHelper
{
    public partial class ShowVolumnFrm : Form
    {
        public ShowVolumnFrm()
        {
            InitializeComponent();
        }
      
       
      
        private void timer1_Tick(object sender, EventArgs e)
        {
            this.Hide();
            timer1.Enabled = false;
        }

        private void linkad_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string url = "";
            LinkLabel link = (LinkLabel)sender;
            if (link.Tag == null)
            {
                url = "http://hi.baidu.com/38809972/blog/item/5a08e05835f4af92800a188e.html?" + DateTime.Now.ToString("yyMMddHHss");
            }
            else
            {
                url = link.Tag.ToString();
            }
            System.Diagnostics.Process.Start("explorer.exe", url);
        }
        int adindex = 0;
        private void timerad_Tick(object sender, EventArgs e)
        {
            if (DukeyComm.ds != null && DukeyComm.ds.Tables.Count > 0)
            {
                if (adindex > DukeyComm.ds.Tables[0].Rows.Count - 1)
                    adindex = 0;
                else
                {
                    linkad.Text = DukeyComm.ds.Tables[0].Rows[adindex]["link_text"].ToString();
                    linkad.Tag = DukeyComm.ds.Tables[0].Rows[adindex]["url"].ToString();
                    adindex++;
                }
            }
            else
            {
                linkad.Tag = "http://hi.baidu.com/38809972/blog/item/5a08e05835f4af92800a188e.html?" + DateTime.Now.ToString("yyMMddHHss");
            }
        }

       

     
    }
}
